﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="True" CodeBehind="FIM_MoneyReturns.aspx.cs" Inherits="KPIS.GERP.GFMS.APP.App_UI.Forms.FIM_MoneyReturns" %>

<%@ Register src="../UserControls/DatePicker.ascx" TagName="DatePicker" TagPrefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>รายการหักล้างเงินยืมด้วยใบสำคัญ</title>
    <link href="../CssClass.css" rel="stylesheet" type="text/css" />
    <script language="JavaScript" src="../Scripts/Common.js" type="text/jscript"></script>
    <script language="JavaScript" src="../Scripts/DatePicker.js" type="text/jscript"></script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function OpenWindows()
            {
                //radopen("FIM_MoneyReturnsOpen.aspx", "RadWindowMR");
                var oWindow = window.radopen("FIM_MoneyReturnsOpen.aspx", "RadWindowMR");
            }

            function openPrintExcel(id) {
                var oWnd = radopen("PopupPrintExcel.aspx?Seq=" + id + "&Type=RT", "RadWindow3");
                oWnd.close();
            }

            function openPrintExcel2(id) {
                var oWnd = radopen("PopupPrintExcel.aspx?Seq=" + id + "&Type=RT2", "RadWindow3");
                oWnd.close();
            }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="pnlFillter">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="PanelView" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="pnlFillter" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="PanelView">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="PanelView" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="PanelEdit" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="pnlFillter" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="PanelEdit">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="PanelView" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="PanelEdit" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="pnlFillter" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None" >
    </telerik:RadAjaxLoadingPanel>
    <div class="DivInfo">
        <table>
            <tr>
                <td>
                    <asp:Panel ID="pnlFillter" runat="server">
           
                        <table style="margin-left:20px">
                            <tr>
                                 <td style="font-size: medium; font-weight: bold; color: #0000FF">
                                        กรองข้อมูล
                                 </td>
                                <td>

                                </td>
                            </tr>
                            <tr>
                                 <td>ปี :</td>
                                 <td>
                                    <telerik:RadNumericTextBox ID="txtBgmYear" runat="server"
                                            Width="100px" ShowSpinButtons="True" AutoPostBack="true"
                                            NumberFormat-DecimalDigits="0" NumberFormat-GroupSeparator=""
                                            OnTextChanged="txtBgmYear_TextChanged" />
                                     <asp:Label ID="lblBgmYear" runat="server" Visible="false"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>สัญญายืม :</td>
                                <td>
                                    <telerik:RadComboBox ID="ddlMoneyRequest" runat="server" Width="550px" Filter="Contains"
                                            DataTextField="money_req_name2" DataValueField="money_req_seq"  AutoPostBack="true"
                                            OnSelectedIndexChanged="ddlMoneyReturns_SelectedIndexChanged">
                                    </telerik:RadComboBox>
                                    <asp:Label ID="lblMoneyReturns" runat="server" Visible="false"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                               <td>ผู้ยืมเงิน :</td>
                                <td>
                                    <telerik:RadComboBox ID="ddlEmp" runat="server"  Width="550px" Filter="Contains"
                                            DataTextField="emp_name" DataValueField="emp_seq" AutoPostBack="true"
                                            OnSelectedIndexChanged="ddlEmp_SelectedIndexChanged">
                                    </telerik:RadComboBox>
                                    <asp:Label ID="lblContact" runat="server" Visible="false"></asp:Label>
                                </td>
                            </tr>
                        </table>
          
                    </asp:Panel>
                </td>
                <td>
                    <button onclick="OpenWindows();return false;" class="Button" style="width: 190px">
                    ทะเบียนคุมสัญญาเงินยืม
                    </button>
                </td>
            </tr>
        </table>
    </div>
    <asp:Panel ID="PanelView" runat="server">
        <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="GrdViewHistory" runat="server"
            AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True"
            Width="998px"  
            GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
            GroupingSettings-GroupContinuedFormatString=""
            GroupingSettings-GroupContinuesFormatString=""
            GroupingSettings-GroupSplitFormat="" 
            CellSpacing="0" GridLines="None" 
            OnItemCommand="GrdViewHistory_ItemCommand" OnItemDataBound="GrdViewHistory_ItemDataBound1">
            <MasterTableView AllowMultiColumnSorting="true" CellSpacing="-1"
                DataKeyNames="return_seq" NoMasterRecordsText="< ไม่มีข้อมูล >">
                <Columns>
                    <telerik:GridBoundColumn DataField="return_seq"
                        UniqueName="return_seq" Visible="False">
                    </telerik:GridBoundColumn>
                     <telerik:GridBoundColumn DataField="emp_seq"
                        UniqueName="emp_seq" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="money_req_seq"
                        UniqueName="money_req_seq" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="money_req_name"
                        UniqueName="money_req_name" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="record_status" 
                        UniqueName="record_status" Visible="False">
                    </telerik:GridBoundColumn>
                
                    <telerik:GridBoundColumn DataField="ref_no" HeaderText="เลขที่รับใบสำคัญ"
                        UniqueName="ref_no" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                        CurrentFilterFunction="Contains" ShowFilterIcon="False">
                        <HeaderStyle Width="100px" HorizontalAlign="Left" />
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="return_date" HeaderText="วันที่หักล้างเงินยืม"
                        UniqueName="return_date" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                        CurrentFilterFunction="Contains" ShowFilterIcon="False" DataFormatString="{0:d}">
                        <HeaderStyle Width="100px" HorizontalAlign="Left" />
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>

                    <telerik:GridBoundColumn DataField="borrow_no" HeaderText="เลขที่สัญญายืม"
                        UniqueName="borrow_no" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                        CurrentFilterFunction="Contains" ShowFilterIcon="False">
                        <HeaderStyle Width="100px" HorizontalAlign="Left" />
                        <ItemStyle HorizontalAlign="Left" ForeColor="Blue" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="debtor_name" HeaderText="ชื่อลูกหนี้"
                        UniqueName="debtor_name" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                        CurrentFilterFunction="Contains" ShowFilterIcon="False">
                        <HeaderStyle HorizontalAlign="Left" />
                        <ItemStyle HorizontalAlign="Left" ForeColor="Blue" />
                    </telerik:GridBoundColumn>

                    <telerik:GridBoundColumn DataField="money_req_total_bath_amount" HeaderText="จำนวนเงินยืม"
                        UniqueName="money_req_total_bath_amount" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                        CurrentFilterFunction="Contains" ShowFilterIcon="False" DataFormatString="{0:n2}"
                        AllowFiltering="false">
                        <HeaderStyle Width="100px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="total_bath_amount" HeaderText="จำนวนเงินที่หักล้าง"
                        UniqueName="total_bath_amount" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                        CurrentFilterFunction="Contains" ShowFilterIcon="False" DataFormatString="{0:n2}"
                        AllowFiltering="false">
                        <HeaderStyle Width="100px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="receive_bath_amount" HeaderText="จำนวนเงินที่คืน"
                        UniqueName="receive_bath_amount" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                        CurrentFilterFunction="Contains" ShowFilterIcon="False" DataFormatString="{0:n2}"
                        AllowFiltering="false">
                        <HeaderStyle Width="100px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="remain_bath_amount" HeaderText="เหลือที่ต้องหักล้าง"
                        UniqueName="remain_bath_amount" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                        CurrentFilterFunction="Contains" ShowFilterIcon="False" DataFormatString="{0:n2}"
                        AllowFiltering="false">
                        <HeaderStyle Width="100px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="remarks" HeaderText="หมายเหตุ" Visible="false"
                        UniqueName="remarks" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                        CurrentFilterFunction="Contains" ShowFilterIcon="False">
                        <HeaderStyle Width="100px" HorizontalAlign="Left" />
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="record_status_name" HeaderText="สถานะรายการ"
                        UniqueName="record_status_name" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                        CurrentFilterFunction="Contains" ShowFilterIcon="False">
                        <HeaderStyle Width="80px" HorizontalAlign="Left" />
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn AutoPostBackOnFilter="true" 
                        CurrentFilterFunction="Contains" DataField="return_seq" 
                        FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="ใบสำคัญชดใช้เงิน/รายการส่งใช้เงินยืม" ShowFilterIcon="false">
                        <ItemTemplate>
                            <asp:LinkButton ID="cmdPrintPopup" runat="server" CssClass="LinkButton" ToolTip="พิมพ์ใบสำคัญชดใช้เงินยืม"
                                OnClientClick='<%# string.Format("return openPrintExcel(\"{0}\");", Eval("return_seq")) %>' >
                                <img alt="" id="imgPrint" runat="server" src="~/App_UI/Images/Buttons/printer.png" style="width:1.5em;height:1.5em;" />
                            </asp:LinkButton>
                            <asp:LinkButton ID="cmdPrintPopUp2" runat="server" CssClass="LinkButton" ToolTip="พิมพ์รายการส่งใช้เงินยืมของสัญญายืม"
                                OnClientClick='<%# string.Format("return openPrintExcel2(\"{0}\");", Eval("money_req_seq")) %>' >
                                <img alt="" id="img1" runat="server" src="~/App_UI/Images/Buttons/printer.png" style="width:1.5em;height:1.5em;" />
                            </asp:LinkButton>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" />
                    </telerik:GridTemplateColumn>
                </Columns>
                <PagerStyle Mode="NumericPages" AlwaysVisible="true" 
                    FirstPageToolTip="กลับหน้าแรก" LastPageToolTip="ไปหน้าสุดท้าย" 
                    NextPagesToolTip="หน้าถัดไป" NextPageToolTip="หน้าถัดไป" 
                    PrevPagesToolTip="ย้อนกลับ" PrevPageToolTip="ย้อนกลับ" >
                </PagerStyle>

            </MasterTableView> 
            <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
                <Selecting AllowRowSelect="true" />
                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
            </ClientSettings>
        </telerik:RadGrid>
    </asp:Panel>
    <asp:Panel ID="PanelEdit" runat="server">
        <div class="DivControl" style="font-weight: bold; color: #FFFFFF;">
            <table>
                <tr>
                    <td width="10px">
                    </td>
                    <td>
                        <asp:Label ID="lblModeName" runat="server" />
                        <asp:Label ID="lblMode" runat="server" Visible="false" />
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td width="10px">
                        
                    </td>
                    <td>
                        ยืนยันรายการยืมเงินที่ต้องการหักล้าง
                    </td>
                </tr>
            </table>
        </div>
        <div class="DivBody">
            <table>
                <tr>
                    <td width="150px" align="right">
                        เลขที่เงินยืม :
                    </td>
                    <td>
                        <asp:Label ID="lblBorrowNo" runat="server" ForeColor="Blue" />
                        <asp:Label ID="lblMoneyReqSeq" runat="server" Visible="false" />
                        <asp:Label ID="lblReturnSeq" runat="server" Visible="false" />
                        <asp:Label ID="lblRecordStatus" runat="server" Visible="false" />
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td width="150px" align="right">
                        ชื่อรายการ :
                    </td>
                    <td>
                        <asp:Label ID="lblMoneyReqName" runat="server" ForeColor="Blue" />
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td width="150px" align="right">
                        วันที่ครบกำหนด :
                    </td>
                    <td>
                        <asp:Label ID="lblBorrowReturnDate" runat="server" ForeColor="Blue" />
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td width="150px" align="right">
                        หมายเหตุ :
                    </td>
                    <td>
                        <asp:Label ID="lblRemarks" runat="server" ForeColor="Red" />
                    </td>
                </tr>
            </table>
        </div>
        <hr />
        <div class="DivBody">
            <table>
                <tr>
                    <td width="150px" align="right">
                        เลขที่ใบรับใบสำคัญ :
                    </td>
                    <td>
                        <asp:Label ID="lblReturnRefNo" runat="server" ForeColor="Blue" />
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td width="150px" align="right">
                        วันที่บันทึกรายการ :
                    </td>
                    <td>
                        <uc1:DatePicker ID="dpReturnDate" runat="server" />
                    </td>
                </tr>
            </table>
        </div>
        <div class="DivInfo">
            <table width="100%">
                <tr>
                    <td align="center">
                        <asp:LinkButton ID="cmdInsert1" runat="server" CssClass="LinkButton"
                            Text="บันทึกข้อมูล" onclick="cmdInsert1_Click" />
                        <asp:LinkButton ID="cmdUpdate1" runat="server" CssClass="LinkButton"
                            Text="บันทึกข้อมูล" onclick="cmdUpdate1_Click" />
                        &nbsp;&nbsp;
                        <asp:LinkButton ID="cmdCancel1" runat="server" CssClass="LinkButton"
                            Text="ยกเลิกการบันทึก" onclick="cmdCancel1_Click" />
                        &nbsp;&nbsp;
                        <asp:LinkButton ID="cmdDelete1" runat="server" CssClass="LinkButton"
                            Text="ลบรายการนี้" onclick="cmdDelete1_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <asp:Panel ID="Panel3" runat="server" Visible="false"><%-- style="border-top-style: solid; border-width: 1px"--%>
            <br />
            <br />
            <div class="DivControl" style="font-weight: bold; color: #FFFFFF;">
                <table>
                    <tr>
                        <td width="10px">
                        </td>
                        <td>
                            กรอกข้อมูลหักล้างค่าใช้จ่ายเงินยืม
                        </td>
                    </tr>
                </table>
            </div>
            <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="grdMoneyReturnDtls" runat="server" AutoGenerateColumns="false"
                AllowMultiRowEdit="false" AllowMultiRowSelection="false" AllowFilteringByColumn="true"
                Width="980px"
                AllowPaging="false" ShowFooter="false"
                GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                GroupingSettings-GroupContinuedFormatString=""
                GroupingSettings-GroupContinuesFormatString=""
                GroupingSettings-GroupSplitFormat=""
                OnItemCommand="grdMoneyReturnDtls_ItemCommand"
                OnItemDataBound="grdMoneyReturnDtls_ItemDataBound">
                <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" GroupLoadMode="Client" Width="100%"
                    DataKeyNames="money_req_dtls_seq" NoMasterRecordsText="< ไม่มีข้อมูล >" GroupsDefaultExpanded="true">
                    <Columns>
                        <telerik:GridBoundColumn DataField="money_req_dtls_seq"
                            UniqueName="money_req_dtls_seq" Visible="False">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="return_dtls_seq"
                            UniqueName="return_dtls_seq" Visible="False">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="return_seq"
                            UniqueName="return_seq" Visible="false">
                        </telerik:GridBoundColumn>
                                       
                        <telerik:GridBoundColumn DataField="bgm_exp_name" HeaderText="ค่าใช้จ่าย"
                            UniqueName="bgm_exp_name"
                            FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                            CurrentFilterFunction="Contains" ShowFilterIcon="False" ItemStyle-HorizontalAlign="Left">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="req_amount" HeaderText="เงินยืม"
                            UniqueName="req_amount" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                            CurrentFilterFunction="Contains" ShowFilterIcon="False" AllowFiltering="false"
                            DataFormatString="{0:n2}" ItemStyle-HorizontalAlign="Right">
                            <HeaderStyle Width="110px" />
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>
                                        
                        <telerik:GridBoundColumn DataField="amount" HeaderText="เงินหักล้าง"
                            UniqueName="amount" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                            CurrentFilterFunction="Contains" ShowFilterIcon="False" AllowFiltering="false"
                            DataFormatString="{0:n2}">
                            <HeaderStyle Width="110px" HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>

                        <telerik:GridTemplateColumn UniqueName="button" AllowFiltering="false">
                            <HeaderStyle Width="30px" HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <asp:LinkButton ID="cmdAddExpense" runat="server" CssClass="LinkButton" CommandName="select">
                                    <img alt="" src="../Images/Buttons/Edit.gif" />
                                </asp:LinkButton>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
                <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" 
                    GroupContinuedFormatString="" GroupContinuesFormatString="" 
                    GroupSplitFormat="" />
                <ClientSettings EnableRowHoverStyle="true">
                    <Selecting AllowRowSelect="false" />
                </ClientSettings>
            </telerik:RadGrid>
            <asp:Panel ID="PanelOpacity" runat="server" Visible="false" CssClass="Opacity">
            </asp:Panel>
            <asp:Panel ID="PanelMoneyReturnDtls" runat="server" CssClass="PanelAbsoluteEdit" Visible="false">
                <div class="DivPopupHeader">
                    <table>
                        <tr>
                            <td>
                                บันทึกจำนวนเงิน
                            </td>
                            <td>
                                <asp:Label ID="lblBgmExpName" runat="server" ForeColor="Blue" />
                                <asp:Label ID="lblMoneyReqDtlsSeq" runat="server" Visible="false" />
                                <asp:Label ID="lblReturnDtlsSeq" runat="server" Visible="false" />
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="DivBody">
                    <table>
                        <tr>
                            <td align="right" width="150px">
                                จำนวนเงินที่ขอยืม :
                            </td>
                            <td align="right" width="130px">
                                <asp:Label ID="lblReqAmount" runat="server" ForeColor="Blue" />
                            </td>
                            <td>
                                บาท
                            </td>
                        </tr>
                    </table>
                    <table>
                        <tr>
                            <td align="right" width="150px">
                                จำนวนเงินที่หักล้าง :
                            </td>
                            <td>
                                <telerik:RadNumericTextBox ID="txtAmount" runat="server" 
                                    CssClass="NumericTextBox">
                                </telerik:RadNumericTextBox>
                            </td>
                            <td>
                                บาท
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="DivInfo">
                    <table width="100%">
                        <tr>
                            <td align="center">
                                <asp:LinkButton ID="cmdInsert3" runat="server" CssClass="LinkButton" onclick="cmdInsert3_Click">
                                    บันทึกข้อมูล
                                </asp:LinkButton>
                                <asp:LinkButton ID="cmdUpdate3" runat="server" CssClass="LinkButton" onclick="cmdUpdate3_Click">
                                    บันทึกข้อมูล
                                </asp:LinkButton>&nbsp;&nbsp;
                                <asp:LinkButton ID="cmdCancel3" runat="server" CssClass="LinkButton" onclick="cmdCancel3_Click">
                                    ยกเลิกการบันทึก
                                </asp:LinkButton>
                            </td>
                        </tr>
                    </table>
                </div>
            </asp:Panel>
        </asp:Panel>
        <br />
        <br />
        <div class="DivInfo" style="font-weight: bold;">
            <table width="100%">
                <tr>
                    <td align="right">
                        <table style="font-weight: bold">
                            <tr>
                                <td>
                                    รวมเงินหักล้าง
                                </td>
                                <td width="130px" align="right">
                                    <asp:Label ID="lblSumReturnBathAmount" runat="server" ForeColor="Blue" />
                                </td>
                                <td>
                                    บาท
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    รวมเงินที่คืน
                                </td>
                                <td width="130px" align="right">
                                    <asp:Label ID="lblSumReceiveBathAmount" runat="server" ForeColor="Blue" />
                                </td>
                                <td>
                                    บาท
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    - รวมเงินยืม
                                </td>
                                <td width="130px" align="right">
                                    <asp:Label ID="lblSumBorrowBathAmount" runat="server" ForeColor="Blue" />
                                </td>
                                <td>
                                    บาท
                                </td>
                            </tr>
                        </table>
                        <table style="border-style: double none none none; border-width: 3px">
                            <tr>
                                <td>
                                    - เงินที่ต้องคืนเพิ่ม / + เงินที่ต้องเบิกเพิ่มเติม
                                </td>
                                <td width="130px" align="right">
                                    <asp:Label ID="lblRemainAmount" runat="server" ForeColor="Red" />
                                </td>
                                <td>
                                    บาท
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <div class="DivInfo" align="center">
                <asp:LinkButton ID="cmdApprove" runat="server" CssClass="LinkButton"
                    Text="ยืนยันการตรวจสอบใบสำคัญ" onclick="cmdApprove_Click" />
                
                <asp:LinkButton ID="cmdUnApprove" runat="server" CssClass="LinkButton"
                    Text="ยกเลิกการยืนยันใบสำคัญและแจ้งเตือนผู้ยืม" onclick="cmdUnApprove_Click" />
            </div>
        </div>
    </asp:Panel>
    <telerik:radwindowmanager runat="server" ID="RadWindowManagerMR" ReloadOnShow="true" Width="870px" Height="680px">
        <Windows>
            <telerik:RadWindow 
                Title="ทะเบียนคุมสัญญาเงินยืม" 
                ID="RadWindowMR"
                runat="server">
            </telerik:RadWindow>
            <telerik:RadWindow runat="server" ID="RadWindow3" Title="พิมพ์ใบสำคัญชดใช้เงิน"
                Width="80px" Height="50px"  >
            </telerik:RadWindow>
        </Windows>
    </telerik:radwindowmanager>
</asp:Content>
